import string
# a = 'hello'
# b = "hello"
# print(type(a))
# print(type(b))

# print("输出结果是{:8s}".format("this"))
# print("输出结果是{:8d}".format(1234))
# print("输出结果是{:08.2f}".format(14.345))

# a = 'hello'
# print(a[1])
# print(a[-1])

# print("12 "*3 == " ".join(["12", "12", "12"]))

# print("输出结果是{:8s}".format("this"))
# print("输出结果是{:8d}".format(1234))
# print("输出结果是{:08.2f}".format(14.345))

# a = r'\n'
# print(a)
# b = '\n'
# print(b)
# c = R'\n'
# print(c)

# print("4" + "6")

# a = "hello world"
# b = a.split();
# c = a.rsplit();
# print(b)
# print(c)

# b = 10
# a = b
# a = 11
# print(b)

# print(5+'class')

# s = "I love Python"
# print(s[2:6])

# s = 'hello'
# n = s.count('l')
# print(n)

# print ('12345abc'.isalnum())
# a = "abc123"
# print(a.islower())

# var = 1234
# print('%010d'%(var))
# print('{:0>10d}'.format(var))
# print(str(var).rjust(10,'0'))
# print(str(var).zfill(10))

# print("我叫%s，今年 %d 岁!" % ('小明', 10))
#
# class Student:
#     def __init__(self, name, age):
#         self.name = name
#         self.age=age
# stu = Student('小明', 10)
# print('我叫{0.name},今年{0.age}岁!'.format(stu))
#
# dct={'name':'小明','age':10}
# print('我叫{name},今年{age}岁!'.format(**dct))
#
# lst=['小明', 10]
# print('我叫{0[0]},今年{0[1]}岁!'.format(lst))

# var = 'abcd01234adfda'
# print(var.strip(string.ascii_letters))

# s = 'hello'
# t = " world"
# s = s+t
# print(s)
# print(s[-1])
# print(s[2:8])

# some_string = "Hi!......"
# print(some_string.strip(".!"))

# print('abcab'.replace('a','yy'))
# print('hello world, hellow every one'.replace('hello', 'hi'))

# print("{1}+{0}={2}".format(2,3,2+3))

# print("aABC".isalpha())

# print('3//11//2018'.split('/'))
# print(len('3//11//2018'.split('/')))

# a=34
# b=23
# print("{1}-{2}={0}".format(34-23,a,b))

# s = 'http://sports.sina.com.cn/'
# print(s.count('t'))
# print(s.index('com'))
# print(s.replace('.', '-'))
# print(s.upper())
# print(len(s))
# print(s + 'index')

# s = str(input())
# a = s.split('_')
# print(a)

import re
s = str(input())
flag = 0
if len(s) < 8:
    e = 1
else:
    if not re.search('[0-9]', s):
        flag = 1
    if not re.search('[A-Z]', s):
        flag = 1
    if not re.search('[a-z]', s):
        flag = 1
    if not re.search('[^0-9a-zA-Z]', s):
        flag = 1
if e == 0:
    print('valid password')
else:
    print('invalid password')